1 package mobisnap.mobile_trx;
2
3 import mobisnap.*;
4
5 /***
6 * Used to represent the print funtion internally
7 */
8 public class MSQLTFunPrint
9 implements MSQLTFunction
10 {
11 public MSQLTFunPrint() {
12 // do nothing
13 }
14
15 /***
16 * Returns the value of the variable
17 */
18 public Object getValue() throws Exception {
19 throw new mobisnap.MobisnapException( "Print: getValue requires 1 parameter");
20 }
21
22 /***
23 * Returns the value of the function / executes subroutine
24 */
25 public Object getValue( Object[] params) throws Exception {
26 if( params == null || params.length != 1)
27 throw new mobisnap.MobisnapException( "Print: getValue requires 1 parameter");
28 System.err.println( MSQLTypeUtil.value2String( params[0]));
29 return null;
30 }
31
32 /***
33 * Sets the value of the given variable
34 */
35 public void setValue( Object obj) throws Exception {
36 throw new mobisnap.MobisnapException( "setValue can not be applied to functions");
37 }
38
39 /***
40 * Returns true if the following parameters can be the parameters of
41 * the function
42 */
43 public boolean parametersOK( Object[] params) {
44 if( params == null || params.length != 3)
45 return false;
46 for( int i = 0; i < 3; i++)
47 if( ! ( params[i] instanceof String))
48 return false;
49 return true;
50 }
51 }
This page was automatically generated by Maven